package com.nidu.demo.dict;

import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.nidu.demo.dict.dto.DictDataAddCmd;
import com.nidu.demo.dict.dto.DictDataListQry;
import com.nidu.demo.dict.dto.DictDataPageQry;
import com.nidu.demo.dict.dto.DictDataUpdateCmd;
import com.nidu.demo.dict.api.SysDictDataService;
import com.nidu.demo.dict.dto.DictDataCO;
import com.nidu.demo.dict.executor.command.DictDataAddCmdExe;
import com.nidu.demo.dict.executor.command.DictDataDeleteCmdExe;
import com.nidu.demo.dict.executor.command.DictDataUpdateCmdExe;
import com.nidu.demo.dict.executor.query.DictDataListQryExe;
import com.nidu.demo.dict.executor.query.DictDataPageQryExe;
import com.nidu.demo.dict.executor.query.DictDataSingleQryExe;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
 * 公司服务实现类
 *
 * @author auto
 */
@Service
@RequiredArgsConstructor
public class SysDictDataServiceImpl implements SysDictDataService {

    private final DictDataAddCmdExe addCmdExe;
    private final DictDataUpdateCmdExe updateCmdExe;
    private final DictDataDeleteCmdExe deleteCmdExe;
    private final DictDataSingleQryExe singleQryExe;
    private final DictDataListQryExe listQryExe;
    private final DictDataPageQryExe pageQryExe;

    @Override
    public SingleResponse<DictDataCO> add(DictDataAddCmd cmd) {
        return addCmdExe.execute(cmd);
    }

    @Override
    public SingleResponse<DictDataCO> update(DictDataUpdateCmd cmd) {
        return updateCmdExe.execute(cmd);
    }

    @Override
    public Response delete(Long id) {
        return deleteCmdExe.execute(id);
    }

    @Override
    public Response delete(Set<Long> ids) {
        return deleteCmdExe.execute(ids);
    }

    @Override
    public SingleResponse<DictDataCO> getById(Long id) {
        return singleQryExe.execute(id);
    }

    @Override
    public MultiResponse<DictDataCO> list(DictDataListQry qry) {
        return listQryExe.execute(qry);
    }

    @Override
    public PageResponse<DictDataCO> page(DictDataPageQry qry) {
        return pageQryExe.execute(qry);
    }
} 